package com.banmoon.proxy.jdkproxy;

public class JdkProxyMain {

    public static void main(String[] args) {
        // 创建目标对象
        ITeacher teacher = new Teacher();
        // 将目标对象传入，让其工厂生产代理对象
        ITeacher teacherProxy = (ITeacher) new JdkProxyFactory(teacher).getProxyInstance();
        // 查看代理对象Class
        System.out.println("teacherProxy：" + teacherProxy.getClass());

        System.out.println("============ 分割线 ============");
        // 调用代理对象teach方法
        teacherProxy.teach();
    }

}
